#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 19 20:21:31 2024

@author: liqingsimac
"""
'''
##第1题：
###############################################
import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(111)
ax.hlines(y=0,xmin=-0.5,xmax=1.5)
ax.vlines(x=0,ymin=-0.5,ymax=1.5)
ax.set_xlim(-1,2)
ax.set_ylim(-1,2)
t=np.linspace(0,1,11)
x=t
y=1-t
ax.plot(x,y,'b-')
ax.plot(0,1,'b.',markersize=15)
ax.plot(1,0,'b.',markersize=15)
ax.set_aspect('equal')
ax.annotate('C',xy=(0.6,0.6),fontsize=15)
ax.set_xticks([0,1])
ax.set_yticks([0,1])
fig.savefig('ca-quiz-03-prob-01.png')
'''

'''
##第3题：
###############################################
import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(111)
ax.hlines(y=0,xmin=-6,xmax=6)
ax.vlines(x=0,ymin=-6,ymax=6)
ax.set_xlim(-6,6)
ax.set_ylim(-6,6)
t=np.linspace(0,2*np.pi,51)
x=np.cos(t)*5.5
y=np.sin(t)*5.5
ax.plot(x,y,'b-')
ax.plot(0,0,'r.',markersize=15)
ax.plot(-3,0,'r.',markersize=15)
ax.set_aspect('equal')
ax.set_xticks([-5,-4,-3,-2,-1,0,1,2,3,4,5])
ax.set_yticks([-5,-4,-3,-2,-1,0,1,2,3,4,5])
ax.annotate('C',xy=(5,3),fontsize=15)
x1=np.cos(t)
y1=np.sin(t)
ax.plot(x1,y1,'r-')
ax.annotate('$C_1$',xy=(0.6,1),fontsize=15)
x2=-3+np.cos(t)
y2=np.sin(t)
ax.plot(x2,y2,'r-')
ax.annotate('$C_2$',xy=(-2.4,1),fontsize=15)
fig.savefig('ca-quiz-03-prob-03.png')
'''

'''
##第4题：
###############################################
import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(111)
ax.hlines(y=0,xmin=-3,xmax=3)
ax.vlines(x=0,ymin=-4,ymax=3)
ax.set_xlim(-3,3)
ax.set_ylim(-4,3)
t=np.linspace(0,2*np.pi,51)
x=np.cos(t)*1
y=-2+np.sin(t)*1
ax.plot(x,y,'b-')
ax.plot(0,-2,'r.',markersize=15)
ax.plot(0,0,'r.',markersize=15)
ax.plot(0,2,'r.',markersize=15)
ax.annotate('2i',xy=(0.1,2.1),fontsize=15)
ax.annotate('0',xy=(0.1,0.1),fontsize=15)
ax.annotate('-2i',xy=(0.1,-1.9),fontsize=15)
ax.set_aspect('equal')
ax.set_xticks([-3,-2,-1,0,1,2,3])
ax.set_yticks([-4,-3,-2,-1,0,1,2,3])
ax.annotate('C',xy=(1,-1.5),fontsize=15)
fig.savefig('ca-quiz-03-prob-04.png')
'''

'''
##第5题：
###############################################
import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(111)
ax.hlines(y=0,xmin=-3,xmax=3)
ax.vlines(x=0,ymin=-3,ymax=3)
ax.set_xlim(-3,3)
ax.set_ylim(-3,3)
t=np.linspace(0,2*np.pi,51)
x=np.cos(t)*2
y=np.sin(t)*2
ax.plot(x,y,'b-')
ax.plot(0,-1,'r.',markersize=15)
ax.annotate('-i',xy=(0.1,-0.9),fontsize=15)

ax.set_aspect('equal')
ax.set_xticks([-3,-2,-1,0,1,2,3])
ax.set_yticks([-3,-2,-1,0,1,2,3])
ax.annotate('C',xy=(2,0.5),fontsize=15)
fig.savefig('ca-quiz-03-prob-05.png')
'''

##第6题：
###############################################
import numpy as np
import matplotlib.pyplot as plt

fig=plt.figure()
ax=fig.add_subplot(111)
ax.hlines(y=0,xmin=-3,xmax=3)
ax.vlines(x=0,ymin=-3,ymax=3)
ax.set_xlim(-3,3)
ax.set_ylim(-3,3)
t=np.linspace(0,2*np.pi,51)
x=np.cos(t)*2
y=np.sin(t)*2
ax.plot(x,y,'b-')
ax.plot(0,1,'r.',markersize=15)
ax.annotate('i',xy=(0.2,1.1),fontsize=15)

ax.set_aspect('equal')
ax.set_xticks([-3,-2,-1,0,1,2,3])
ax.set_yticks([-3,-2,-1,0,1,2,3])
ax.annotate('C',xy=(2,0.5),fontsize=15)
fig.savefig('ca-quiz-03-prob-06.png')





